/**
 * 代理配置
 */

const { UMI_ENV } = process.env;

/**
 * 接口前缀 用于代理
 */

const ProConfig = {
  /**
    * base 路径前缀
    * api api服务地址
    * filePath 静态文件存储服务地址
    * esignH5 电子签h5服务地址
    * bankH5 行方开发h5服务地址
    */
  mock: {
    base: '/',
    api: 'http://localhost:7000',
    filePath: 'http://localhost:7000',
    esignH5: 'http://192.168.0.97:3098',
    bankH5: 'http://www.baidu.com'
  },
  dev: {
    base: '/',
    filePath: 'http://192.168.0.41:7085',
    esignH5: 'http://192.168.0.97:3097/zj/wechat_personal_eloan/ui/dzq-resource',
    bankH5: 'http://www.baidu.com',
    // api: 'http://192.168.2.139:9091',
    api: 'http://47.98.102.239:8091',
    // api: 'http://192.168.0.33:7081',
  },
  test: {
    base: '/',
    // api: 'http://192.168.2.139:9091',
    // api: 'http://192.168.0.100:9091',
    filePath: 'http://192.168.0.41:7085',
    esignH5: 'http://192.168.0.97:3097/zj/wechat_personal_eloan/ui/dzq-resource',
    bankH5: 'http://www.baidu.com',
    // api: 'http://192.168.2.139:9091',
    api: 'http://192.168.0.41:7081',
    // api: 'http://192.168.0.33:7081',
  },
  pro: {
    base: '/zj/wechat_personal_eloan/ui/h5-manager/',
    api: 'https://cloud.bankofchina.com',
    filePath: 'https://cloud.bankofchina.com',
    esignH5: 'http://192.168.0.97:3098',
    bankH5: 'http://www.baidu.com'
  },
};
console.log('代理配置 ----->', ProConfig[UMI_ENV],)
export default {
  
  [`${ProConfig[UMI_ENV].base}api`]: {
    target: ProConfig[UMI_ENV].api,
    changeOrigin: true,
    pathRewrite: { '^/api': '/api' }
  },
  [`${ProConfig[UMI_ENV].base}filePath`]: {
    target: ProConfig[UMI_ENV].filePath,
    changeOrigin: true,
    pathRewrite: { '^/filePath': '' }
  },
  [`${ProConfig[UMI_ENV].base}esignH5`]: {
    target: ProConfig[UMI_ENV].esignH5,
    changeOrigin: true,
    pathRewrite: { '^/esignH5': '' },
    autoRewrite: true,
  },
  [`${ProConfig[UMI_ENV].base}/bankH5`]: {
    target: ProConfig[UMI_ENV].bankH5,
    changeOrigin: true,
    pathRewrite: { '^/bankH5': '' }
  },

};
